import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView/HomeView.vue'
import SpecialView from '../views/SpecialView/SpecialView.vue'
import SpecialTitleView from '../views/SpecialView/SpecialTitleView.vue'
import SearchView from '../views/SearchView/SearchView.vue'
import MeView from '../views/MeView.vue'
import LoginView from '../views/LoginView.vue'
import RegisterView from '../views/RegisterView.vue'
import ArticlesView from '@/views/ArticlesView/ArticlesView.vue'
import CollectionView from '../views/CollectionView.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    meta: {
      showTabbar: true,
      keepAlive: true
    }
  },
  {
    path: '/articles/:id',
    name: 'articles',
    component: ArticlesView,
    meta: {
      showTabbar: false,
      keepAlive: false
    }
  },
  {
    path: '/sapecial',
    name: 'sapecial',
    component: SpecialView,
    meta: {
      showTabbar: true,
      keepAlive: true
    }
  },
  {
    path: '/sapecial/sapecialTitle',
    name: 'sapecialTitle',
    component: SpecialTitleView,
    meta: {
      showTabbar: false,
      keepAlive: false
    }
  },
  {
    path: '/search',
    name: 'search',
    component: SearchView,
    meta: { showTabbar: true,
      keepAlive: true }
  },
  {
    path: '/me',
    name: 'me',
    component: MeView,
    meta: {
      showTabbar: true,
      keepAlive: true
    }
  },
  {
    path: '/collection',
    name: 'collection',
    component: CollectionView,
    meta: {
      showTabbar: false,
      keepAlive: false
    }
  },
  {
    path: '/login',
    name: 'login',
    component: LoginView,
    meta: {
      showTabbar: false,
      keepAlive: false
    }
  },
  {
    path: '/register',
    name: 'register',
    component: RegisterView,
    meta: {
      showTabbar: false,
      keepAlive: false
    }
  },

  
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
